package org.i1510.base.utils.jdbcTest;



import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class MysqlTest {
	public static void main(String[] args) {
		String url = "jdbc:mysql://192.168.189.180:3306/lw?autoReconnect=true&useUnicode=true&characterEncoding=utf-8";
		try {
			Class.forName("com.mysql.jdbc.Driver"); // 建表后先commit才能在其它端中调用

			Connection conn = DriverManager.getConnection(url, "root", "572wqc");
			Statement stmt = conn.createStatement(); // 建表时的插入语句记得为' ',而不是" "
			String strSql = "SELECT * FROM datachk.z_salesms_config";// 将sql中将;去掉
			ResultSet rs = stmt.executeQuery(strSql);
			while (rs.next()) {
				// System.out.println("TestID:"+rs.getString(1));
				System.out.println(rs.getObject(1) + "\t" + rs.getObject(2));
				// System.out.println("Describe:"+rs.getString(2));
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.exit(0);

	}
}
